
import 'dart:async';

import 'package:fun4live/controller/baseController.dart';
import 'package:get/get.dart';
import 'package:perfect_volume_control/perfect_volume_control.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:screen_brightness/screen_brightness.dart';
import 'package:fijkplayer/fijkplayer.dart';
import 'package:floating/floating.dart';

mixin PlayerMixin{
  //GlobalKey <VieoState> globalPlayerKey 
  late final player = FijkPlayer();

  //late final videoController = videoController
}

mixin PlayerStateMixin on PlayerMixin{

}
mixin PlayerDanmakuMixin on PlayerStateMixin {

  final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
  final screenBrightness = ScreenBrightness();
  final pip = Floating();
  //StreamSubscription<PipStatus>? _pupSubscription;

  void initSystem() async{
    PerfectVolumeControl.hideUI = true;
  }

 // WakelockPlus.enable();
}
mixin PlayerSystemMixin on PlayerMixin, PlayerStateMixin, PlayerDanmakuMixin {
  final pip = Floating();
  StreamSubscription<PiPStatus>? _pipSubscription;
  void initSystem() async{
    PerfectVolumeControl.hideUI = true;
  }
}

mixin PlayerGestureControlMixin 
    on PlayerStateMixin,PlayerMixin,PlayerSystemMixin{

    }

class PlayerController extends BaseController
    with PlayerMixin,PlayerStateMixin,PlayerDanmakuMixin,PlayerSystemMixin,PlayerGestureControlMixin
    
{
  @override
  void onInit(){

    super.onInit();
  }
  //StreamSubscription<String>? _errorSubscription;
  //StreamSubscription? _completedSubscription;
  //StreamSubscription? _widthSubscription;
  //StreamSubscription? _heightSubscription;
  //StreamSubscription? _logSubscription;

  void initStream(){

  }
  @override
  void onClose() async {

  }

}